home *** CD-ROM | disk | FTP | other *** search
- /* exlibsrc.c (usually archived in a linker library) */
-
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
- void Block(win,col,x1,y1,width,height) /* Block zeichnen */
- struct Window *win;
- int col,x1,y1,width,height;
- {
- struct RastPort *RP;
- if(width==0 || height ==0) return;
- RP=win->RPort;
- SetDrMd(RP,JAM1);
- SetAPen(RP,col);
- RectFill(RP,x1,y1,x1+width-1,y1+height-1);
- }
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
-
- void Box(win,col1,col2,x1,y1,width,height) /* leere Box mit Rahmen zeichnen */
- struct Window *win;
- int col1,col2,x1,y1,width,height;
- {
- struct RastPort *RP;
- if(width==0 || height==0) return;
- RP=win->RPort;
- SetDrMd(RP,JAM1);
- SetAPen(RP,col1);
- RectFill(RP,x1,y1,x1+width-1,y1+height-1);
- SetAPen(RP,col2);
- RectFill(RP,x1+1,y1+1,x1+width-2,y1+height-2);
- }
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
- #include <proto/intuition.h>
- void Cls(win,col) /* Bildschirm l÷schen in Farbe col */
- struct Window *win;
- int col;
- {
- Move(win->RPort,0,0); /* Rastport in die obere linke Ecke setzen */
- SetRast(win->RPort,col);
- RefreshWindowFrame(win);
- RemakeDisplay();
- }
-
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
-
- void Ellipse(win,col,x,y,rx,ry) /* Ellipse zeichnen */
- struct Window *win;
- int col,x,y,rx,ry;
- {
- struct RastPort *RP;
- RP=win->RPort;
- SetDrMd(RP,JAM1);
- SetAPen(RP,col);
- DrawEllipse(RP,x,y,rx,ry);
- }
- /* oeffnet CONSOLE-Window f. (Revision-)Messages */
-
- #include <exec/types.h>
-
- extern char ProgId[],Version[];
- extern int Revision;
- extern char UserId[],Date[];
-
- int OpenRevWin(size)
- char *size;
- {
- int window;
- char Str1[180],Str2[190];
- window=open(size,2,0);
- if(window==-1)
- return(-1);
- sprintf(Str1,"%s %s - Revision %d\n\n",ProgId,Version,Revision);
- sprintf(Str2,"latest update by: %s %s\n\n",UserId,Date);
- WrConWin(window,Str1);
- WrConWin(window,Str2);
- return(window);
- }
-
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
-
- void Pixel(win,col,x,y) /* Punkt setzen */
- struct Window *win;
- int col,x,y;
- {
- struct RastPort *RP;
- RP=win->RPort;
- SetDrMd(RP,JAM1);
- SetAPen(RP,col);
- WritePixel(RP,x,y);
- }
- #include <intuition/intuition.h>
- #include <proto/intuition.h>
- #include <proto/graphics.h>
-
- Print(win,text,col1,col2,xpos,ypos) /* Ausgabe von Text */
- struct Window *win;
- char *text;
- int col1,col2,xpos,ypos;
- {
- int dx=4,width=win->GZZWidth;
- struct RastPort *RP;
-
- /* if((width-strlen(text)*8) < 0) return; */ /* Text zu lang */
- RP=win->RPort;
- SetDrMd(RP,JAM2);
- SetAPen(RP,col1);
- SetBPen(RP,col2);
- if (win->Flags & GIMMEZEROZERO) dx=0;
- if(xpos == -1) xpos=(width-strlen(text)*8)/2+dx; /* zentriert */
- if(xpos == -2) xpos=width-strlen(text)*8+dx; /* rechtsbⁿndig */
- Move(RP,xpos,ypos);
- Text(RP,text,strlen(text));
- }
- /***************************************************************************
- * ReqBlock.c: zeichnet ein Viereck in einen Requester(!!) *
- * *
- * created: 1990 Mtwx *
- * updated: 06-Aug-91 Mtwx *
- ***************************************************************************/
-
- /* ------------------------------- includes ----------------------------- */
-
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
-
- /* ------------------------------- routines ----------------------------- */
-
- void ReqBlock(req, col, x1, y1, width, height)
- struct Requester *req;
- int col, x1, y1, width, height;
- {
- struct RastPort *RP;
-
- if (width == 0 || height == 0)
- return;
- RP = req->ReqLayer->rp;
- SetDrMd(RP, JAM1);
- SetAPen(RP, col);
- RectFill(RP, x1, y1, x1 + width - 1, y1 + height - 1);
- }
- #include <intuition/intuition.h>
- ReqBox(req,col1,col2,x1,y1,width,height) /* leere Box mit Rahmen im
- Requester zeichnen */
- struct Requester *req;
- int col1,col2,x1,y1,width,height;
- {
- struct RastPort *RP;
- if(width==0 || height==0) return;
- RP=req->ReqLayer->rp;
- SetDrMd(RP,JAM1);
- SetAPen(RP,col1);
- RectFill(RP,x1,y1,x1+width-1,y1+height-1);
- SetAPen(RP,col2);
- RectFill(RP,x1+1,y1+1,x1+width-2,y1+height-2);
- }
-
-
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
- void ReqPrint(req,text,col1,col2,xpos,ypos) /* Ausgabe von Text */
- struct Requester *req;
- char *text;
- int col1,col2,xpos,ypos;
- {
- int width=req->Width;
- struct RastPort *RP;
-
- RP=req->ReqLayer->rp;
- SetDrMd(RP,JAM2);
- SetAPen(RP,col1);
- SetBPen(RP,col2);
- if(xpos == -1) xpos=(width-strlen(text)*8)/2; /* zentriert */
- if(xpos == -2) xpos=width-strlen(text)*8; /* rechtsbⁿndig */
- Move(RP,xpos,ypos);
- Text(RP,text,strlen(text));
- }
- #include <intuition/intuition.h>
- #include <proto/graphics.h>
-
- void Shadow(win,text,txtc,shdwc,xpos,ypos) /* Ausgabe von Text */
- struct Window *win; /* mit Schatten */
- char *text;
- int txtc,shdwc,xpos,ypos;
- {
- int dx=4,width=win->GZZWidth;
- struct RastPort *RP;
-
- RP=win->RPort;
- SetDrMd(RP,JAM1);
- SetAPen(RP,shdwc);
- if(win->Flags & GIMMEZEROZERO) dx=0;
- if(xpos==-1) xpos=(width-strlen(text)*8)/2+dx;
- if(xpos==-2) xpos=width-strlen(text)*8+dx;
- Move(RP,xpos+1,ypos+1);
- Text(RP,text,strlen(text));
- SetAPen(RP,txtc);
- Move(RP,xpos,ypos);
- Text(RP,text,strlen(text));
- }
- int strpos(s1,s2)
- char *s1,*s2;
- {
- register int i;
- int n,pos=0,flag=0;
-
- if(strlen(s2) > strlen(s1)) return -1;
- for(i=0;i<strlen(s1)-strlen(s2)+1;i++)
- {
- n=strncmp(&s1[i],s2,strlen(s2));
- if(n==0)
- {
- pos=i;
- flag=1;
- break;
- }
- }
- if(!flag) pos=-1;
- return pos;
- }
- #include <exec/types.h>
-
- #define EXIST 0
- #define EXECUTE 1
- #define WRITE 2
- #define READ 4
-
- BOOL TestFile(file)
- char *file;
- {
- int Erfolg;
- Erfolg=access(file,EXIST);
- if(Erfolg==0) return (TRUE);
- else return (FALSE);
- }
-
-
- void WrConWin(win,text)
- int win;
- char *text;
- {
- write(win,text,strlen(text));
- }
-